package com.llt.system.controller.user;


import com.llt.common.core.controller.BaseController;
import com.llt.common.core.domain.R;
import com.llt.common.core.domain.TableDataInfo;
import com.llt.system.domain.user.dto.UserDTO;
import com.llt.system.domain.user.dto.UserQueryDTO;
import com.llt.system.service.user.IUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author llt
 * @since 2024-10-21
 */
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController extends BaseController {

    private final IUserService userService;

    /**
     * 获取用户列表
     */
    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO dto) {
        return getTableDataInfo(userService.list(dto));
    }

    /**
     * 拉黑
     */
    @PutMapping("/updateStatus")
    public R<Void> updateStatus(@RequestBody UserDTO dto) {
        return toR(userService.updateStatus(dto));
    }

}
